package comc.springbatch;

import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.flow.FlowExecutionStatus;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.stereotype.Component;

@Component
public class MyDecider implements JobExecutionDecider {
    private int count=2;
    @Override
    public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
        count++;
        if (count%2==0){
            System.out.println("count"+count);
            return new  FlowExecutionStatus("222");
        }
        else {
            System.out.println("count"+count);
            return new FlowExecutionStatus("111");
        }

    }
}
